package ru.st.selenium.applogic3;

import ru.st.selenium.applogic3.DriverBasedHelper3;
import ru.st.selenium.applogic.TelerikHelper;

public class TelerikHelper3 extends DriverBasedHelper3 implements TelerikHelper {

	private String baseUrl;

	public TelerikHelper3(ApplicationManager3 manager) {
		super(manager.getWebDriver());
		this.baseUrl = manager.getBaseUrl();
	}

	@Override
	public void openMainPage() {
		driver.get(baseUrl);
	}

	@Override
	public boolean isOpened() {
		return pages.telerikPage.waitPageLoaded();
	}

	@Override
	public void gotoContacts() {
		pages.telerikPage.ensurePageLoaded().clickContactsFolder();
	}

	@Override
	public void gotoCalendar() {
		pages.telerikPage.ensurePageLoaded().clickCalendarFolder();
	}

	@Override
	public void gotoNotes() {
		pages.telerikPage.ensurePageLoaded().clickNotesFolder();
	}

	@Override
	public void gotoMail() {
		pages.telerikPage.ensurePageLoaded().clickMailFolder();
	}

	@Override
	public void gotoClickAllInputFields() {
		try {
			pages.telerikPage.ensurePageLoaded().clickMailInputFolders();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}